Next | Prev | Up | Top | Contents | Index

Queue Priorities

sendmail assigns a priority to every message when it is first instantiated. sendmail uses the priority and the message creation time (in seconds since January 1, 1970) to order the queue. The message with the lowest priority number is processed first. The algorithm that derives a message's priority uses the following information:

message size (in bytes)


Small messages receive lower priorities than large messages, increasing the efficiency of the queue.

message class


If the user includes a "Precedence:" field and value in a message, sendmail uses the value to select the message class from the configuration file. (Typical values might be "first-class" or "bulk.")

class work factor


This factor is set in the configuration file with the z option; its default value is 1800.

number of recipients


The number of recipients affects the load a message presents to the system. A message with a single recipient has a lower priority than one with a long recipient list.

recipient work factor


This factor is set in the configuration file with the y option; its default value is 1000.
The priority algorithm is as follows:

priority=message_size-(message_class * z)+(num_recipients * y)

After assigning message priorities, sendmail orders the queue by using the following formula:

ordering = priority + creation_time

A message's priority can change each time an attempt is made to deliver it. The "work time factor" (set with the Z option) is a value that increments the priority, on the assumption that a message that has failed many times will tend to fail in the future.


Next | Prev | Up | Top | Contents | Index